<template>
  <div class="elTableVue">
    <el-table
      class="el-table"
      v-on="$listeners"
      v-bind="$attrs"
      style="width: 100%">
      <el-table-column
        v-for="(e, i) in headData"
        :key="i"
        :prop="e.prop"
        :label="e.label"
        :width="e.width"
      >
      </el-table-column>
    </el-table>
    <elPaginationVue class="elPaginationVue" @currentChange="currentChange"/>
  </div>
</template>

<script>
import elPaginationVue from '../elPaginationVue/index.vue';

export default {
  name: 'elTableVue',
  components: { elPaginationVue },
  props: {
    headData: {
      type: Array,
      default: () => [],
    },
    tableData: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {};
  },
  methods: {
    currentChange(pageNum) {
      this.$emit('currentChange', pageNum);
    },
  },
};
</script>

<style scoped lang="scss">
  .elTableVue {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    .el-table {
      flex: 1;
      overflow: hidden;
    }
  }
</style>
